package cn.edu.sdjzu.xg.eagle.entity;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;

/**
 * @author tg.si@188.com
 * @project xg22
 * @date 2024/3/26
 */
@NoArgsConstructor
@Getter
@Setter
@ToString
public class School extends Department {
    private Integer id; // 对应着数据库表中的非业务主键 object id
    private String no;
    private String description;
    private String remarks;

    public School(Integer id, String description, String no, String remarks) {
        this(description, no, remarks);
        this.id = id;
    }

    public School(String description, String no, String remarks) {
        super();
        this.description = description;
        this.no = no;
        this.remarks = remarks;
    }

    @Override
    public int compareTo(Department o) {
        if (o instanceof School) {
            return this.no.compareTo(((School) o).no);
        }
        return super.compareTo(o); // 调用父类的 compareTo 方法
    }
}

